project(1.3-cnn-and-dynamic-shape)

set(BASE_PATH /media/chyang/data/third_party/linux)
set(CUDA_HOME ${BASE_PATH}/cuda/cuda_12.3)
set(TRT_HOME ${BASE_PATH}/tensorrt/TensorRT-8.6.1.6/)

# Find CUDA.
include_directories(${CUDA_HOME}/include)
link_directories(${CUDA_HOME}/lib)

# include_directories(${TRT_HOME}/include/)
# link_directories(${TRT_HOME}/lib)

find_package(protobuf CONFIG REQUIRED)

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/src)
include_directories(/media/chyang/data/code/project/Project-DMAI-Deploy/tutorials/tensorrt/1.6-onnx-parser-source-code/src)

aux_source_directory(/media/chyang/data/code/project/Project-DMAI-Deploy/tutorials/tensorrt/1.6-onnx-parser-source-code/src/onnx-tensorrt-release-8.0/ ONNX2TRT_DIR)
# add_library(tensorrt2onnx SHARED ${ONNX2TRT_DIR})
add_library(plugin11 SHARED ${ONNX2TRT_DIR})
target_link_libraries(plugin11 cuda cudart protobuf::libprotoc protobuf::libprotobuf protobuf::libprotobuf-lite)

add_executable(main src/main.cpp)
target_link_libraries(main PUBLIC cuda cudart ${plugin11} protobuf::libprotoc protobuf::libprotobuf protobuf::libprotobuf-lite)